package com.ds.infra.rpc.example.api;


import com.ds.infra.rpc.example.api.dto.OrderDTO;
import com.ds.infra.rpc.example.api.exception.ApiException;

import java.util.List;

/**
 * 订单服务接口
 */
public interface OrderService {

    /**
     * 创建订单
     */
    OrderDTO createOrder(OrderDTO orderDTO) throws ApiException;

    /**
     * 根据订单ID查询订单
     */
    OrderDTO getOrderById(Long orderId) throws ApiException;

    /**
     * 取消订单
     */
    boolean cancelOrder(Long orderId) throws ApiException;

    /**
     * 根据用户ID查询订单列表
     */
    List<OrderDTO> getOrdersByUserId(Long userId) throws ApiException;
}
